home *** CD-ROM | disk | FTP | other *** search
/ MacGames Sampler / PHT MacGames Bundle.iso / MacSource Folder / Samples from the CD / Assembly / Mac68k / MANUAL / MAN7.DOC < prev    next >
Encoding:
Text File  |  1985-08-11  |  14.6 KB  |  518 lines  |  [TEXT/Anon]

  1.  
  2. MAC.68K
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.                                  IF
  10.                                  IF
  11.                                  IF
  12.  
  13.  
  14.  
  15.  
  16.  
  17.   PURPOSE         To conditionally assemble or skip source lines based
  18.  
  19.  
  20.                on an attribute test.
  21.  
  22.  
  23.  
  24.  
  25.  
  26.   FORMAT     IF   attribute,expression
  27.  
  28.  
  29.              IF  -attribute,expression
  30.  
  31.  
  32.      ifname  IF   attribute,expression
  33.  
  34.  
  35.      ifname  IF  -attribute,expression
  36.  
  37.  
  38.              IF   attribute,expression,lcnt
  39.  
  40.  
  41.              IF  -attribute,expression,lcnt
  42.  
  43.  
  44.      ifname  IF   attribute,expression,lcnt
  45.  
  46.  
  47.      ifname  IF  -attribute,expression,lcnt
  48.  
  49.  
  50.  
  51.       attribute            TRUE if
  52.  
  53.  
  54.  
  55.        DEF            All symbols in expression are defined.
  56.  
  57.  
  58.        AREG           Expression is an address register direct.
  59.  
  60.  
  61.        DREG           Expression is a data register direct.
  62.  
  63.  
  64.        IREG           Expression is an indirect register reference.
  65.  
  66.  
  67.        ABS            Expression is an absolute memory reference.
  68.  
  69.  
  70.        PREL           Expression is a program relative reference.
  71.  
  72.  
  73.        SREG           Expression is a status register.
  74.  
  75.  
  76.        IMMD           Expression is immediate data.
  77.  
  78.  
  79.  
  80.  
  81.  
  82.   DESCRIPTION     IF tests an expression for an attribute and begins
  83.  
  84.  
  85.                assembling the IF block if the test is true, or begins
  86.  
  87.  
  88.                skipping if the test is not true.  By using a - prefix
  89.  
  90.  
  91.                on the attribute type, the effect of the test is
  92.  
  93.  
  94.                reversed.
  95.  
  96.  
  97.  
  98.                    The IF block is either bounded by ELSE/ENDC pseudo
  99.  
  100.  
  101.                op codes, or is a specified line count in length. If
  102.  
  103.  
  104.                the line count parameter lcnt is used, the following
  105.  
  106.  
  107.                source lines are skipped until either the count is
  108.  
  109.  
  110.                exhausted, or until an unnamed ELSE or a named ELSE
  111.  
  112.  
  113.                with a matching ifname is found.  If a count is not
  114.  
  115.  
  116.                specified, the IF block is terminated by an unnamed
  117.  
  118.  
  119.                ENDC or a matching named ENDC. Within the block the
  120.  
  121.  
  122.                effects of the test may be reversed by an unnamed ELSE
  123.  
  124.  
  125.                or an ELSE with a matching ifname.
  126.  
  127.  
  128.  
  129.                    By using named IF blocks, a virtually unlimited
  130.  
  131.  
  132.                amount of conditional nesting may occur.
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.                               -37-                              MAC.68K
  143.  
  144.  
  145.  
  146.                                                                 MAC.68K
  147.  
  148.  
  149.  
  150.  
  151.  
  152.                                 IFS / IFC
  153.                                 IFS / IFC
  154.                                 IFS / IFC
  155.  
  156.  
  157.  
  158.  
  159.   PURPOSE         To conditionally skip or assemble source lines based
  160.  
  161.  
  162.                on string comparisons.
  163.  
  164.  
  165.  
  166.  
  167.   FORMAT               IFS    comparision,dstring1dstring2d
  168.  
  169.  
  170.                        IFS    comparision,dstring1dstring2d,lcnt
  171.  
  172.  
  173.              ifname    IFS    comparision,dstring1dstring2d
  174.  
  175.  
  176.              ifname    IFS    comparision,dstring1dstring2d,lcnt
  177.  
  178.  
  179.  
  180.               comparison       EQ  NE  GE  GT  LE  LT
  181.  
  182.  
  183.  
  184.               d                String delimiter character. Any character
  185.  
  186.  
  187.                                not occuring in string 1 or in string 2
  188.  
  189.  
  190.                                except for & or ".
  191.  
  192.  
  193.  
  194.               string           Character strings to compare
  195.  
  196.  
  197.  
  198.               lcnt             Optional source line skip count
  199.  
  200.  
  201.  
  202.  
  203.   DESCRIPTION     IFS compares two strings and begins assembly if the
  204.  
  205.  
  206.                comparison is true, or begins skipping source lines if
  207.  
  208.  
  209.                the comparison is false. The comparison is done left
  210.  
  211.  
  212.                to right until the condition is found false or the
  213.  
  214.  
  215.                strings are exhausted. A short string is logically
  216.  
  217.  
  218.                padded with null characters.
  219.  
  220.  
  221.  
  222.                    The IF block is either bounded by ELSE/ENDC pseudo
  223.  
  224.  
  225.                op codes, or is a specified line count in length. If
  226.  
  227.  
  228.                the line count parameter lcnt is used, the following
  229.  
  230.  
  231.                source lines are skipped until either the count is
  232.  
  233.  
  234.                exhausted, or until an unnamed ELSE or a named ELSE
  235.  
  236.  
  237.                with a matching ifname is found.  If a count is not
  238.  
  239.  
  240.                specified, the IF block is terminated by an unnamed
  241.  
  242.  
  243.                ENDC or a matching named ENDC. Within the block the
  244.  
  245.  
  246.                effects of the test may be reversed by an unnamed ELSE
  247.  
  248.  
  249.                or an ELSE with a matching ifname.
  250.  
  251.  
  252.  
  253.                    By using named IF blocks, a virtually unlimited
  254.  
  255.  
  256.                amount of conditional nesting may occur.
  257.  
  258.  
  259.  
  260.                    The pseudo ops IFC and IFNC are recognized and
  261.  
  262.  
  263.                processed as the equivalent IFS pseudo ops. Their
  264.  
  265.  
  266.                format is the same as described by AS68.
  267.  
  268.  
  269.  
  270.   EXAMPLE    RETURN    MACRO   ADDR
  271.  
  272.  
  273.                        IFS     EQ,*ADDR**       TEST FOR NULL PARAMETER
  274.  
  275.  
  276.                        RTS
  277.  
  278.  
  279.                        ELSE
  280.  
  281.  
  282.                        BRA     ADDR
  283.  
  284.  
  285.                        ENDC
  286.  
  287.  
  288.                        ENDM
  289.  
  290.  
  291.  
  292.  
  293.  
  294. MAC.68K                                  -38-
  295.  
  296.  
  297.  
  298. MAC.68K
  299.  
  300.  
  301.  
  302.  
  303.  
  304.                                 IFxx
  305.                                 IFxx
  306.                                 IFxx
  307.  
  308.  
  309.  
  310.  
  311.  
  312.   PURPOSE         To conditionally assemble or skip source lines based
  313.  
  314.  
  315.                on a comparison of two expressions.
  316.  
  317.  
  318.  
  319.  
  320.  
  321.   FORMAT               IFxx   expression1
  322.  
  323.  
  324.                        IFxx   expression1,expression2
  325.  
  326.  
  327.                        IFxx   expression1,expression2,lcnt
  328.  
  329.  
  330.              ifname    IFxx   expression1,expression2
  331.  
  332.  
  333.              ifname    IFxx   expression1,expression2,lcnt
  334.  
  335.  
  336.  
  337.                    xx           EQ  NE  GE  GT  LE  LT
  338.  
  339.  
  340.  
  341.                    lcnt         Optional source line skip count.
  342.  
  343.  
  344.  
  345.  
  346.  
  347.   DESCRIPTION     IFxx compares two expressions and begins assembly
  348.  
  349.  
  350.                if the xx condition is true, or begins skipping if the
  351.  
  352.  
  353.                xx condition is false.  If expression2 is not present,
  354.  
  355.  
  356.                expression1 is compared to zero.  Any symbols used in
  357.  
  358.  
  359.                the expressions must be previously defined.
  360.  
  361.  
  362.  
  363.                    The IF block is either bounded by ELSE/ENDC pseudo
  364.  
  365.  
  366.                op codes, or is a specified line count in length. If
  367.  
  368.  
  369.                the line count parameter lcnt is used, the following
  370.  
  371.  
  372.                source lines are skipped or assembled until either the
  373.  
  374.  
  375.                count is exhausted, or until an unnamed ELSE or a
  376.  
  377.  
  378.                named ELSE with a matching ifname is found.  If a
  379.  
  380.  
  381.                count is not specified, the IF block is terminated by
  382.  
  383.  
  384.                an unnamed ENDC or a matching named ENDC. Within the
  385.  
  386.  
  387.                block the effects of the test may be reversed by an
  388.  
  389.  
  390.                unnamed ELSE or an ELSE with a matching ifname.
  391.  
  392.  
  393.  
  394.                    By using named IF blocks, a virtually unlimited
  395.  
  396.  
  397.                amount of conditional nesting may occur.
  398.  
  399.  
  400.  
  401.  
  402.  
  403.   EXAMPLES             IFGT    PAGSIZE,24
  404.  
  405.  
  406.                        BSR     ADVANP
  407.  
  408.  
  409.                        ELSE
  410.  
  411.  
  412.                        BSR     ADVANL
  413.  
  414.  
  415.                 FOO    IFLE    BAZ,BAZLIMIT,3
  416.  
  417.  
  418.                        BSR     SETBAZ
  419.  
  420.  
  421.                 FOO    ENDC
  422.  
  423.  
  424.                        ENDC
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.                               -39-                              MAC.68K
  435.  
  436.  
  437.  
  438.                                                                 MAC.68K
  439.  
  440.  
  441.  
  442.  
  443.  
  444.                               INCLUDE
  445.                               INCLUDE
  446.                               INCLUDE
  447.  
  448.  
  449.  
  450.  
  451.  
  452.   PURPOSE         To insert text from another file into the assembly.
  453.  
  454.  
  455.  
  456.  
  457.  
  458.   FORMAT               INCLUDE  filename
  459.  
  460.  
  461.  
  462.  
  463.  
  464.   DESCRIPTION     INCLUDE reads in all the text from the specified
  465.  
  466.  
  467.                file name and MAC.68K then assembles that text before
  468.  
  469.  
  470.                resuming assembly with the next line of input. INCLUDE
  471.  
  472.  
  473.                may be nested to 5 levels.
  474.  
  475.  
  476.  
  477.                    MAC.68K uses a default extension of blanks.
  478.  
  479.  
  480.  
  481.  
  482.  
  483.   EXAMPLES             INCLUDE  IODECKS.TXT
  484.  
  485.  
  486.                        INCLUDE  B:IODECKS
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524. MAC.68K                                  -40-
  525.  
  526.  
  527.  
  528. MAC.68K
  529.  
  530.  
  531.  
  532.  
  533.  
  534.                               INCLUDEH
  535.                               INCLUDEH
  536.                               INCLUDEH
  537.  
  538.  
  539.  
  540.  
  541.  
  542.   PURPOSE         To load a previously assembled object module.
  543.  
  544.  
  545.  
  546.  
  547.  
  548.   FORMAT               INCLUDEH  filename
  549.  
  550.  
  551.  
  552.  
  553.  
  554.   DESCRIPTION     INCLUDEH reads in a previously assembled .MOD
  555.  
  556.  
  557.                file.  MAC.68K adds the current value of the location
  558.  
  559.  
  560.                counter to any entry point symbol values from the .MOD
  561.  
  562.  
  563.                file and enters the symbol names in the symbol table.
  564.  
  565.  
  566.                MAC.68K then inserts the object code from the .MOD
  567.  
  568.  
  569.                file at the current origin counter and advances the
  570.  
  571.  
  572.                origin and location counters by the length of the
  573.  
  574.  
  575.                object code.
  576.  
  577.  
  578.  
  579.                    MAC.68K uses a default extension of .MOD.
  580.  
  581.  
  582.  
  583.  
  584.  
  585.   EXAMPLE              INCLUDEH  RUNIO
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.                               -41-                              MAC.68K
  621.  
  622.  
  623.  
  624.                                                                 MAC.68K
  625.  
  626.  
  627.  
  628.  
  629.  
  630.                               INCLUDES
  631.                               INCLUDES
  632.                               INCLUDES
  633.  
  634.  
  635.  
  636.  
  637.  
  638.   PURPOSE         To load a previously assembled set of symbols and macro
  639.  
  640.  
  641.                definitions.
  642.  
  643.  
  644.  
  645.  
  646.  
  647.   FORMAT               INCLUDES  filename
  648.  
  649.  
  650.                        INCLUDES  filename,symbol,symbol,...symbol
  651.  
  652.  
  653.  
  654.  
  655.  
  656.   DESCRIPTION     INCLUDES is an initialization directive. It must
  657.  
  658.  
  659.                appear after the IDENT card but before any
  660.  
  661.  
  662.                non-initialization operation codes.
  663.  
  664.  
  665.  
  666.                    INCLUDES reads a previously assembled .STX file
  667.  
  668.  
  669.                and enters the symbols and macros from the .STX file
  670.  
  671.  
  672.                into the current symbol and macro tables.  A maximum
  673.  
  674.  
  675.                of three INCLUDES may be used in one assembly. In the
  676.  
  677.  
  678.                case of duplicate symbol or macro definitions, the
  679.  
  680.  
  681.                first one encountered is used.
  682.  
  683.  
  684.  
  685.                    MAC.68K uses a default extension of .STX .
  686.  
  687.  
  688.  
  689.                    A list of symbol names that are NOT to be defined
  690.  
  691.  
  692.                may appear after the filename. This allows the program
  693.  
  694.  
  695.                to define its own values for those symbols.
  696.  
  697.  
  698.  
  699.  
  700.  
  701.   EXAMPLES             INCLUDES  CPMTEXT
  702.  
  703.  
  704.                        INCLUDES  CPMTEXT,FCBL
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730. MAC.68K                                  -42-
  731.  
  732.  
  733.  
  734. MAC.68K
  735.  
  736.  
  737.  
  738.  
  739.  
  740.                                 LIST
  741.                                 LIST
  742.                                 LIST
  743.  
  744.  
  745.  
  746.  
  747.  
  748.   PURPOSE         To select which lines are written to the list file.
  749.  
  750.  
  751.  
  752.  
  753.  
  754.   FORMAT               LIST   option1,option2,...optionN
  755.  
  756.  
  757.  
  758.    Default      Option        Line type controlled by option
  759.  
  760.  
  761.  
  762.      -            A           Image prior to concatenation and string
  763.  
  764.  
  765.                               substitution.
  766.  
  767.  
  768.      -            C           Op codes: PAGE SPACE TITLE and SUBTTL.
  769.  
  770.  
  771.      -            D           DUPlicated lines.
  772.  
  773.  
  774.      -            E           DEFERed lines.
  775.  
  776.  
  777.      -            F           IF skipped lines.
  778.  
  779.  
  780.      -            G           M68000 instructions and data op codes.
  781.  
  782.  
  783.                               Overrides LIST options M and S.
  784.  
  785.  
  786.      -            I           Included text lines.
  787.  
  788.  
  789.      +            L           All source lines.
  790.  
  791.  
  792.      -            M           User macro expansions.
  793.  
  794.  
  795.      -            S           System macro expansions.
  796.  
  797.  
  798.                   $           All options.
  799.  
  800.  
  801.                   *           Reinstate options in effect prior to
  802.  
  803.  
  804.                               previous LIST.
  805.  
  806.  
  807.  
  808.  
  809.  
  810.   DESCRIPTION     LIST options are a single character or a single
  811.  
  812.  
  813.                character prefixed by a -. Multiple options separated
  814.  
  815.  
  816.                by commas may be used, and are scanned from left to
  817.  
  818.  
  819.                right. A single character enables the option and the -
  820.  
  821.  
  822.                prefix disables the option.
  823.  
  824.  
  825.  
  826.                    Line types are inclusive in nature and all LIST
  827.  
  828.  
  829.                options that apply must be selected before a source
  830.  
  831.  
  832.                line is listed. For example, to list an IF skipped
  833.  
  834.  
  835.                line within a user macro called in an included text
  836.  
  837.  
  838.                file requires options L,I,M,F to be enabled.
  839.  
  840.  
  841.  
  842.                    The prior list option is remembered and may be
  843.  
  844.  
  845.                restored by using LIST *.  LIST -$ will turn off all
  846.  
  847.  
  848.                options. LIST G is useful for listing macro
  849.  
  850.  
  851.                expansions.
  852.  
  853.  
  854.  
  855.  
  856.  
  857.   EXAMPLES             LIST    -L
  858.  
  859.  
  860.                        LIST    L,F,-M
  861.  
  862.  
  863.                        LIST    *
  864.  
  865.  
  866.  
  867.  
  868.  
  869.  
  870.  
  871.  
  872.                               -43-                              MAC.68K
  873.  
  874.  
  875.  
  876.                                                                 MAC.68K
  877.  
  878.  
  879.  
  880.  
  881.  
  882.                                 LOC
  883.                                 LOC
  884.                                 LOC
  885.  
  886.  
  887.  
  888.  
  889.  
  890.   PURPOSE         To set the current location counter.
  891.  
  892.  
  893.  
  894.  
  895.  
  896.   FORMAT               LOC    expression
  897.  
  898.  
  899.  
  900.  
  901.  
  902.   DESCRIPTION     The location counter is used to assign address
  903.  
  904.  
  905.                values to location field symbols on M68000
  906.  
  907.  
  908.                instructions and data pseudo ops. It may be set
  909.  
  910.  
  911.                independent of the origin counter.
  912.  
  913.  
  914.  
  915.                    By default the location counter equals the origin
  916.  
  917.  
  918.                counter, and a new ORG will also automatically reset
  919.  
  920.  
  921.                the LOC counter. Caution is advised when changing the
  922.  
  923.  
  924.                LOC because code generated with mismatching ORG and
  925.  
  926.  
  927.                LOC values probably will not execute properly.
  928.  
  929.  
  930.  
  931.                    All symbols used in the expression to generate the
  932.  
  933.  
  934.                new LOC value must be previously defined.
  935.  
  936.  
  937.  
  938.                    The current value of the location counter may be
  939.  
  940.  
  941.                referenced by using the special symbols * or *L.
  942.  
  943.  
  944.  
  945.                    Often used to assemble blocks of code to be moved
  946.  
  947.  
  948.                at execution time from the ORGed address to the LOCed
  949.  
  950.  
  951.                address. Also used for assembly of table definitions
  952.  
  953.  
  954.                containing relative addresses (see also OFFSET).
  955.  
  956.  
  957.  
  958.  
  959.  
  960.   EXAMPLES             LOC   $FF0000
  961.  
  962.  
  963.                        LOC   *O       Reset LOC to current origin address
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986. MAC.68K                                  -44-
  987.  
  988.  
  989. eset LOC to current origin address
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012. MAC.68K